package com.yzmoney.wechat.model.reply;

import org.eclipse.persistence.oxm.annotations.XmlCDATA;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import java.util.ArrayList;
import java.util.List;


/*
回复语音消息
<xml>
<ToUserName><![CDATA[toUser]]></ToUserName>
<FromUserName><![CDATA[fromUser]]></FromUserName>
<CreateTime>12345678</CreateTime>
<MsgType><![CDATA[voice]]></MsgType>
<Voice>
<MediaId><![CDATA[media_id]]></MediaId>
</Voice>
</xml>

参数   是否必须   说明 
ToUserName  是  接收方帐号（收到的OpenID）  
FromUserName  是  开发者微信号  
CreateTime  是  消息创建时间戳 （整型）  
MsgType  是  语音，voice  
MediaId  是  通过上传多媒体文件，得到的id  
*/

@XmlRootElement(name="xml")
@XmlType(propOrder={"mediaId"})
public class ReplyVoiceMsg extends BaseReplyMsg {
	
	@XmlCDATA
	@XmlElementWrapper(name="Voice")
	@XmlElement(name="MediaId")
	private List<String> mediaId;

	public ReplyVoiceMsg() {
		super();
		this.msgType = "voice";
	}

	public ReplyVoiceMsg(List<String> mediaId) {
		super();
		this.msgType = "voice";
		this.mediaId = mediaId;
	}

	public List<String> getMediaId() {
		return mediaId;
	}

	public void setMediaId(List<String> mediaId) {
		this.mediaId = mediaId;
	}
	
	public void setMediaId(String mediaId) {
		this.mediaId = new ArrayList<String>(1);
		this.mediaId.add(mediaId);
	}
}
